package com.trust.entity.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.trust.agri.sign.validate.SaveValidate;
import com.trust.agri.sign.validate.UpdateValidate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author ccc
 * @desc
 * @since 2023/11/15 14:40
 */
@Data
@ApiModel("种植vo")
public class FarmPlantVO {

    @ApiModelProperty("id")
    @Null(message = "id 只能为空", groups = {SaveValidate.class})
    @NotNull(message = "id 不能为空", groups = {UpdateValidate.class})
    private Integer id;

    @ApiModelProperty("作物当前进度")
    //@NotNull(message = "作物当前进度 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer cropProgress;

    @ApiModelProperty("作物生长周期")
    @NotNull(message = "作物生长周期 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private BigDecimal growthCycle;

    @ApiModelProperty("种植面积")
    @NotNull(message = "种植面积 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private BigDecimal plantArea;

    @ApiModelProperty("种植地块")
    @NotEmpty(message = "种植地块 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private List<Integer> plantLandList;

    @ApiModelProperty(value = "种植地块str 入参不用", allowEmptyValue = true)
    private String plantLand;

    @ApiModelProperty(value = "种植地块编号 入参不用", allowEmptyValue = true)
    private List<String> plantLandCode;

    @ApiModelProperty("种植批号")
    @NotBlank(message = "种植批号 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String code;

    @ApiModelProperty("种植标识")
    @NotBlank(message = "种植标识 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String plantSign;

    @ApiModelProperty("播种移栽结束时间")
    @NotNull(message = "播种移栽结束时间 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
    private Date plantEndTime;

    @ApiModelProperty("种植开始时间")
    @NotNull(message = "种植开始时间 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8")
    private Date plantStart;

    @ApiModelProperty("种植品类")
    @NotNull(message = "种植品类 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer categoryId;

    @ApiModelProperty(value = "种植品类名称", allowEmptyValue = true)
    private String categoryName;

    @ApiModelProperty("种苗数量")
    @NotNull(message = "种苗数量 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer seedNum;

    @ApiModelProperty("种苗批号")
    @NotNull(message = "种苗批号 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private Integer breedCode;

    @ApiModelProperty(value = "种苗批号名称", allowEmptyValue = true)
    private String breedCodeName;

    @ApiModelProperty("前茬作物")
    @NotBlank(message = "前茬作物 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String stubbleCrop;

    @ApiModelProperty(value = "状态 1进行中，2已结束", allowEmptyValue = true)
    private Integer state;

    @ApiModelProperty("地块标识颜色")
    @NotBlank(message = "地块标识颜色 不能为空", groups = {SaveValidate.class, UpdateValidate.class})
    private String color;
}
